import request from "@/utils/request";

//登陆接口
export const login = (username:string,password:string) => {
    return request({
        url: '/user/login',
        method: 'post',
        data: {
            username,
            password
        }
    })
}

//  验证手机号是否被注册过
export const checkPhone = (tel: string) => {
    return request({
        url: '/user/docheckphone',
        method: 'post',
        data: {
            tel
        }
    })
}

//获取验证码
export const sendMsgCode = (tel: string) => {
    return request({
        url: '/user/dosendmsgcode',
        method: 'post',
        data: {
            tel
        }
    })
}

//验证短信验证码
export const checkCode = (tel: string, telcode: string)=>{
    return request({
        url: '/user/docheckcode',
        method: 'post',
        data: {
            tel,telcode
        }
    })
}

//电话注册接口
export const register = (tel: string, password: string) => {
    return request({
        url: '/user/dofinishregister',
        method: 'post',
        data: {
            tel, password
        }
    })
}